﻿<%@ Page Title="" Language="C#" MasterPageFile="~/ReportsAndStatistics/ReportsAndStatisticsPages.master" AutoEventWireup="true" CodeBehind="GeneralReport.aspx.cs" Inherits="WebApp.ReportsAndStatistics.GeneralReport" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<asp:Content ID="Content1" ContentPlaceHolderID="scriptCssContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="contentPlaceHolder" runat="server">
    <h3 style="text-align:center;">BÁO CÁO TỔNG HỢP</h3>

    <fieldset title="Thông tin báo cáo">
        <legend>Thông tin báo cáo</legend>
        <table style="width:100%; border:0px;">
            <tr>
                <td class="ISoft_LabelTitle" style="width:15%;">Loại sản phẩm</td>
                <td class="ISoft_Input" style="width:35%;">
                    <telerik:RadComboBox
                        ID="rcbProductType" Runat="server" Skin="<%$ Resources:Strings, Skin%>" 
                        MarkFirstMatch="True" Width="100%" Height="150px" 
                        AllowCustomText="True" EmptyMessage="Chọn loại sản phẩm">
                        <ExpandAnimation Type="None" />
                        <CollapseAnimation Type="None" />
                    </telerik:RadComboBox>
                </td>

                <td class="ISoft_LabelTitle" style="width:15%;">Loại sửa chữa</td>
                <td class="ISoft_Input" style="width:35%;">
                    <telerik:RadComboBox 
                        ID="rcbRepairingType" Runat="server" Skin="<%$ Resources:Strings, Skin%>"
                        MarkFirstMatch="True" Width="100%" Height="150px" 
                        AllowCustomText="True" EmptyMessage="Chọn loại sửa chữa">
                        <ExpandAnimation Type="None" />
                        <CollapseAnimation Type="None" />
                    </telerik:RadComboBox>
                    
                </td>
            </tr>

            <tr>
                <td class="ISoft_LabelTitle">Người sửa</td>
                <td class="ISoft_Input">
                    <telerik:RadComboBox
                        ID="rcbRepairer" Runat="server" Skin="<%$ Resources:Strings, Skin%>" 
                        MarkFirstMatch="True" Width="100%" Height="150px" 
                        AllowCustomText="True" EmptyMessage="Chọn người sửa">
                        <ExpandAnimation Type="None" />
                        <CollapseAnimation Type="None" />
                    </telerik:RadComboBox>
                </td>

                <td>&nbsp;</td>
                <td>&nbsp;</td>
            </tr>

            <tr>
                <td class="ISoft_LabelTitle">Báo cáo từ ngày</td>
                <td class="ISoft_Input">
                    <telerik:RadDatePicker ID="rdpReportDateFrom" Runat="server" Skin="<%$ Resources:Strings, Skin%>" 
                                            Culture="Vietnamese (Vietnam)" Width="200px">
                        <Calendar ID="Calendar1" runat="server" UseRowHeadersAsSelectors="False" UseColumnHeadersAsSelectors="False" 
                                    ViewSelectorText="x" Skin="<%$ Resources:Strings, Skin%>" >
                        </Calendar>

                        <DatePopupButton ImageUrl="" HoverImageUrl="" ToolTip="Bấm vào đây để chọn ngày."></DatePopupButton>
                        <DateInput ID="DateInput1" runat="server" DisplayDateFormat="dd/MM/yyyy" DateFormat="dd/MM/yyyy" EmptyMessage="Chọn báo cáo từ ngày">
                            <ClientEvents OnError="DateError" />
                        </DateInput>
                        <ClientEvents OnDateSelected="DateSelected" />
                    </telerik:RadDatePicker>
                </td>

                <td class="ISoft_LabelTitle">đến ngày</td>
                <td class="ISoft_Input">
                    <telerik:RadDatePicker ID="rdpReportDateTo" Runat="server" Skin="<%$ Resources:Strings, Skin%>" 
                                            Culture="Vietnamese (Vietnam)" Width="200px">
                        <Calendar ID="Calendar2" runat="server" UseRowHeadersAsSelectors="False" UseColumnHeadersAsSelectors="False" 
                                    ViewSelectorText="x" Skin="<%$ Resources:Strings, Skin%>" >
                        </Calendar>

                        <DatePopupButton ImageUrl="" HoverImageUrl="" ToolTip="Bấm vào đây để chọn ngày."></DatePopupButton>
                        <DateInput ID="DateInput2" runat="server" DisplayDateFormat="dd/MM/yyyy" DateFormat="dd/MM/yyyy" EmptyMessage="Chọn báo cáo đến ngày">
                            <ClientEvents OnError="DateError" />
                        </DateInput>
                        <ClientEvents OnDateSelected="DateSelected" />
                    </telerik:RadDatePicker>
                </td>
            </tr>
        </table>
    </fieldset>

    <table style="width:100%; border:0px;">
        <tr>
            <td class="ISoft_ButtonsRow" colspan="4">
                <telerik:RadButton ID="btnReport" runat="server" 
                    Skin="<%$ Resources:Strings, Skin%>" Text="<%$ Resources:Strings, Report %>" 
                    Width="100px" onclick="btnReport_Click"></telerik:RadButton>
            </td>
        </tr>

        <tr>
            <td colspan="4">
                <telerik:RadGrid ID="grdResult" runat="server" AllowPaging="true" AllowSorting="true"
                                EnableEmbeddedSkins="true" 
                    Skin="<%$ Resources:Strings, Skin%>" 
                    onitemcreated="grdResult_ItemCreated" 
                    onneeddatasource="grdResult_NeedDataSource" 
                    onitemdatabound="grdResult_ItemDataBound" 
                    onpageindexchanged="grdResult_PageIndexChanged" 
                    onpagesizechanged="grdResult_PageSizeChanged">
                    <HeaderStyle Wrap="true" Font-Bold="true" HorizontalAlign="Center" Font-Size="10pt" />
                    <AlternatingItemStyle Font-Names="arial,tahoma,sans-serif" Font-Size="12px" BorderStyle="Solid"/>                
                    <ItemStyle Font-Names="arial,tahoma,sans-serif" Font-Size="12px" BorderColor="#2299DD"/>
                    
                    <PagerStyle  HorizontalAlign="Right" Mode="NextPrevNumericAndAdvanced"
                                PagerTextFormat="Chọn trang: {4} &amp;nbsp;|&amp;nbsp; Trang hiện tại: {0} / {1}, mẫu tin: {2} - {3} / {5}." AlwaysVisible="True"/>
                    
                    <MasterTableView AutoGenerateColumns="false" NoMasterRecordsText="<%$ Resources:Strings, NoMasterRecordsText%>">
            
                        <Columns>
                            <telerik:GridTemplateColumn HeaderText="STT">
                                <HeaderStyle Width="30px" />
                                <ItemStyle HorizontalAlign="Center" />
                                <ItemTemplate>
                                    <asp:Label style="text-align:center" id="lblSTT" runat="server" Text='<%# grdResult.CurrentPageIndex*grdResult.PageSize + grdResult.Items.Count+1 %>' />
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>

                            <telerik:GridBoundColumn DataField="RepairingTicketID" UniqueName="RepairingTicketID" Visible="false">
                            </telerik:GridBoundColumn>

                            <telerik:GridBoundColumn DataField="DisplayColor" UniqueName="DisplayColor" Visible="false">
                            </telerik:GridBoundColumn>

                            <telerik:GridBoundColumn DataField="VisibleCheckWarranty" UniqueName="VisibleCheckWarranty" Visible="false">
                            </telerik:GridBoundColumn>

                            <telerik:GridBoundColumn DataField="IsValidWarranty" UniqueName="IsValidWarranty" Visible="false">
                            </telerik:GridBoundColumn>

                            <telerik:GridTemplateColumn HeaderText="Tên KH" UniqueName="FullName" SortExpression="FullName">
                                <ItemTemplate>
                                    <asp:HyperLink runat="server" ID="hplFullName" Text='<%# DataBinder.Eval(Container.DataItem, "FullName") %>'></asp:HyperLink>
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Left" Width="15%"/>
                            </telerik:GridTemplateColumn>

                            <telerik:GridBoundColumn HeaderText="Địa Chỉ" DataField="Address" UniqueName="Address" SortExpression="Address">
                                <ItemStyle HorizontalAlign="Left" Width="15%"/>
                            </telerik:GridBoundColumn>

                            <telerik:GridBoundColumn HeaderText="Loại Sản Phẩm" DataField="ProductTypeName" UniqueName="ProductTypeName" SortExpression="ProductTypeName">
                                <ItemStyle HorizontalAlign="Left" Width="10%"/>
                            </telerik:GridBoundColumn>
                
                            <telerik:GridBoundColumn HeaderText="Model" DataField="Model" UniqueName="Model" SortExpression="Model">
                                <ItemStyle HorizontalAlign="Left" Width="10%"/>
                            </telerik:GridBoundColumn>

                            <telerik:GridBoundColumn HeaderText="Ngày Sửa Xong" DataField="CreatedDate" UniqueName="CreatedDate" SortExpression="CreatedDate">
                                <ItemStyle HorizontalAlign="Center" Width="10%"/>
                            </telerik:GridBoundColumn>

                            <telerik:GridBoundColumn HeaderText="Người Sửa" DataField="Repairer" UniqueName="Repairer" SortExpression="Repairer">
                                <ItemStyle HorizontalAlign="Center" Width="10%"/>
                            </telerik:GridBoundColumn>

                            <telerik:GridBoundColumn HeaderText="Loại Sửa Chữa" DataField="RepairingTypeName" UniqueName="RepairingTypeName" SortExpression="RepairingTypeName">
                                <ItemStyle HorizontalAlign="Left" Width="10%"/>
                            </telerik:GridBoundColumn>

                            <telerik:GridBoundColumn HeaderText="Tiền Thu Khách Hàng" DataField="Cost" UniqueName="Cost" SortExpression="Cost">
                                <ItemStyle HorizontalAlign="Center" Width="15%"/>
                            </telerik:GridBoundColumn>

                            <telerik:GridTemplateColumn HeaderText="Xác Nhận BH" UniqueName="ColCheckWarranty">
                                <ItemTemplate>
                                    <asp:Image runat="server" ID="imgCheckWarranty" ImageAlign="Middle" ImageUrl="~/images/NoCheckWarranty.gif"/>
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Center" Width="30px" />
                            </telerik:GridTemplateColumn>
                        </Columns>
                    </MasterTableView>
                </telerik:RadGrid>
            </td>
        </tr>

        <tr>
            <td class="ISoft_LabelTitle ISoft_TotalItem" style="width:20%;">Số lượng: </td>
            <td class="ISoft_Input" style="width:30%;">
                <asp:Label runat="server" ID="lblTotalQuantity" Text="" CssClass="ISoft_TotalItem"></asp:Label>
            </td>

            <td class="ISoft_LabelTitle ISoft_TotalItem" style="width:20%;">Tổng tiền thu khách hàng: </td>
            <td class="ISoft_Input" style="width:30%;">
                <asp:Label runat="server" ID="lblTotalCost" Text="" CssClass="ISoft_TotalItem"></asp:Label>
            </td>
        </tr>
    </table>
</asp:Content>
